package com.xing.serviceedu.client;

import com.xing.commonutils.R;
import com.xing.serviceedu.client.impl.OssClientFeignClient;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.multipart.MultipartFile;

/**
 * FeignClient通过nacos 调用其他服务
 *
 *
 * @author: xingfuhao
 * @create: 2022-03-09 21:36
 **/

//调用的服务名称，失败后会滚的实现类
//@FeignClient(name = "service-oss",url = "ip和端口号要写的，这个不知道的话，去nacos上面看详情可以知道的",fallback = OssClientFeignClient.class)
@Component
public interface OssClient {
    //定义调用的方法的路径
    //上传文件到Oss
    //@PathVariable注解一定要指定参数名称，否则出错

    @PostMapping(consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public R uploadOssFile(MultipartFile file);

    @PostMapping("/eduoss/fileoss/a")
    public R a();
}
